package com.gofaraway.service.左神算法课;

/**
 * @author ChenPeng
 * @Date 2024/12/15 16:34
 */
public class Code01_PrintB {

    public static void print(int num) {
        for (int i = 31; i >= 0; i--) {
            System.out.print((num & (1 << i)) == 0 ? "0" : "1");
        }
        System.out.println();
    }


    public static void main(String[] args) {
        int a = 2;
        int b = 3;
        print(a);
        print(b);

        print(a & b);
        print(a | b);

    }
}
